home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / util / wb / DosMan121.lha / man / Set < prev    next >
Text File  |  1995-04-03  |  5KB  |  111 lines

  1.  
  2.  
  3.  
  4.      Set (1.3/2.x/3.x internal)  
  5.  
  6.  
  7.             NB: I was unable to test this properly with 1.3. I 
  8.         would appreciate anyone who has tried it to please help 
  9.         me correct the problems.
  10.  
  11.      NAME
  12.           Set - Set or clear the value of an environment variable.
  13.  
  14.      SYNOPSIS
  15.           Set varname [string]
  16.  
  17.      DESCRIPTION
  18.  
  19.             First, let's discuss what an environmental variable 
  20.         is. It is a named text string which stores an 
  21.         environmental space and is accessible only to the Shell 
  22.         from which it was created. To have that variable to be 
  23.         accessed by any program or CLI (hence, a global variable) 
  24.         then use the SETENV command.  SETENV stores the variable 
  25.         in the private system memory, while Set stores it in the 
  26.         RAM.
  27.  
  28.             This is different from environment variables created 
  29.         with the new V1.3 "SetEnv" and "GetEnv" commands.  
  30.         Programs which use the arp.library environment variables 
  31.         will be able to read variables set by either "Set" or 
  32.         "Setenv".
  33.  
  34.             To set the value of an environment variable, simply 
  35.         use SET VARNAME=VAL, which sets the value of VARNAME to 
  36.         VAL.  To remove this environment variable do Set VARNAME= 
  37.         or Set VARNAME. There is no limit to the number of 
  38.         variables you can set and clear with one command.  You 
  39.         can intermix setting and clearing variables on the same 
  40.         command line.
  41.  
  42.             To view the values of all current environment 
  43.         variables, simply use Set without any arguments.
  44.  
  45.             You can use spaces in your variable names and values, 
  46.         but it is not generally a good idea.  If you do use 
  47.         spaces, you must surround the complete expression with 
  48.         double quotes, i.e., "Variable Name=Variable Value". Note 
  49.         that the similar looking expression "Variable Name = 
  50.         Variable Value" has hidden spaces.  The Variable ends 
  51.         with a space, and the value begins with one. This is only 
  52.         one example of how problematical spaces in environment 
  53.         variables and values can become.
  54.  
  55.             Set also has special features for setting the Escape 
  56.         character. You can set the current escape character by 
  57.         using the ESCAPE <char> keyword.
  58.  
  59.             One source of problems with old script files and 1.3, 
  60.         2.x, and 3.x is the use of the star "*" to refer to the 
  61.         current window.  Pre 1.3 programs tend to regard the star 
  62.         "*" as a wildcard, as is common.  If you use the BCPL 
  63.         keyword to do SET BCPL TRUE, those programs which tend to 
  64.         have problems with this will attempt to overlook the "*" 
  65.         as a wildcard.
  66.  
  67.             Finally, you can get a listing of all variables, 
  68.         including the values of ESCAPE and BCPL by using the 
  69.         keyword LISTALL.
  70.  
  71.             Under 2.x/3.x there are several environmental 
  72.         variables which are automatically set for you, or which 
  73.         you may set for yourself. These are:
  74.  
  75.             Process: The process number of the current shell 
  76.         or task.
  77.  
  78.             RC : The Return Code of the last command executed. 
  79.         This lets you examine some code without using the IF WARN 
  80.         or IF FAIL commands.
  81.  
  82.             Result2: The error number that will indicate why the 
  83.         last command failed. The FAULT command may be used to 
  84.         interpret these.
  85.  
  86.             Echo: This local environment controls whether or not 
  87.         the Shell repeats each command as you execute it. If Echo 
  88.         is SET on, the commands are repeated. If you set it to 
  89.         anything else or not at all they are not repeated. 
  90.         Turning this on is a good way to debug your scripts that 
  91.         don't work. Many times there is really no other way to 
  92.         see why they failed. Echo will print each line as it 
  93.         executes and will tell you which ran properly, and which 
  94.         didn't.
  95.  
  96.             To remove a variable, you may use the UNSET command.
  97.  
  98.             EXAMPLE
  99.           Set DODAH=SONG dateformat=0 copyflags= ESCAPE \
  100.  
  101.           The command line above creates or redefines the variable
  102.           DODAH to have the value SONG, dateformat to have the value
  103.           0, removes the variable copyflags from the environment, and
  104.           sets the current ESCAPE character to \.
  105.  
  106.      ADDITIONAL CONSIDERATIONS
  107.             The Shell also has builtin environment variable 
  108.         expansion and assignment features.
  109.  
  110.  
  111.